//
// Decompiled by Jadx - 424ms
//
package fp;

import com.google.gson.Gson;
import de.robv.android.xposed.XposedHelpers;
import fn.j;
import fn.x;
import fn.y;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import o.a;

@a("DY")
public final class w extends x {
    /* JADX WARN: Removed duplicated region for block: B:53:0x012b  */
    /* JADX WARN: Removed duplicated region for block: B:84:0x0146  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static void cp(w wVar, Object obj) {
        boolean z;
        int i;
        boolean z2;
        boolean z3;
        String str;
        boolean z4;
        boolean z5;
        boolean z6;
        int intField;
        boolean z7;
        boolean z8;
        boolean z9;
        boolean z10;
        boolean z11;
        boolean z12;
        boolean z13;
        boolean z14;
        Object objectField;
        wVar.getClass();
        String str2 = "items";
        List list = (List) XposedHelpers.getObjectField(obj, "items");
        ArrayList arrayList = new ArrayList();
        List cg = y.cg("ScreenString");
        boolean ae = j.ae("ScreenRun");
        boolean ae2 = j.ae("ScreenAD");
        boolean ae3 = j.ae("ImageHide");
        boolean ae4 = j.ae("RecommendedCards");
        boolean ae5 = j.ae("RecommendedMerchants");
        boolean ae6 = j.ae("CopyRightLongVideo");
        int cd = y.cd(0, "longLimit");
        String str3 = "diggCount";
        int cd2 = y.cd(0, "diggCount");
        Gson gson = new Gson();
        if (list != null) {
            Iterator it = list.iterator();
            while (it.hasNext()) {
                Object next = it.next();
                Iterator it2 = it;
                String json = gson.toJson(next);
                Gson gson2 = gson;
                String as = j.as(next, "title");
                boolean cl = y.cl(json, cg);
                boolean cl2 = y.cl(as, cg);
                List list2 = cg;
                Object aa = j.aa(next, "isLive");
                if (aa != null) {
                    z = ((Boolean) aa).booleanValue();
                } else {
                    z = false;
                }
                Object objectField2 = XposedHelpers.getObjectField(next, "video");
                String str4 = str2;
                if (objectField2 != null) {
                    i = XposedHelpers.getIntField(objectField2, "videoLength");
                } else {
                    i = 0;
                }
                if (i > cd && i > 0 && cd > 0) {
                    z2 = true;
                } else {
                    z2 = false;
                }
                if (XposedHelpers.getObjectField(next, "anchorInfo") != null) {
                    z3 = true;
                } else {
                    z3 = false;
                }
                int i2 = cd;
                if (cd2 > 0 && (objectField = XposedHelpers.getObjectField(next, "statistics")) != null) {
                    str = str3;
                    if (XposedHelpers.getLongField(objectField, str3) < cd2) {
                        z4 = true;
                        if (!j.ae("ScreenLive") && z) {
                            z5 = true;
                        } else {
                            z5 = false;
                        }
                        if (!j.ae("ScreenGame") && z3) {
                            z6 = true;
                        } else {
                            z6 = false;
                        }
                        intField = XposedHelpers.getIntField(next, "awemeType");
                        int i3 = cd2;
                        if ((intField != 127 || intField == 128) && ae6) {
                            z7 = ae6;
                            z8 = true;
                        } else {
                            z7 = ae6;
                            z8 = false;
                        }
                        if (intField != 140 && ae5) {
                            z9 = ae5;
                            z10 = true;
                        } else {
                            z9 = ae5;
                            z10 = false;
                        }
                        if (intField != 145 && ae4) {
                            z11 = true;
                        } else {
                            z11 = false;
                        }
                        boolean z15 = ae3;
                        if (!ae3 && intField == 68) {
                            z12 = !((List) XposedHelpers.getObjectField(next, "images")).isEmpty();
                        } else {
                            z12 = false;
                        }
                        if (!ae2) {
                            Object objectField3 = XposedHelpers.getObjectField(next, "author");
                            z13 = ae2;
                            if (objectField3 != null) {
                                z14 = XposedHelpers.getBooleanField(objectField3, "isAdFake");
                            } else {
                                z14 = false;
                            }
                            if (!cl) {
                                cl = json.contains("为什么看到此广告");
                            }
                        } else {
                            z13 = ae2;
                            z14 = false;
                        }
                        if (!cl && !cl2 && !z14 && !z5 && !z6 && !z12 && !z4 && !z11 && !z10 && !z8 && !z2) {
                            arrayList.add(next);
                        }
                        it = it2;
                        gson = gson2;
                        cg = list2;
                        str2 = str4;
                        cd = i2;
                        cd2 = i3;
                        ae6 = z7;
                        str3 = str;
                        ae5 = z9;
                        ae3 = z15;
                        ae2 = z13;
                    }
                } else {
                    str = str3;
                }
                z4 = false;
                if (!j.ae("ScreenLive")) {
                }
                z5 = false;
                if (!j.ae("ScreenGame")) {
                }
                z6 = false;
                intField = XposedHelpers.getIntField(next, "awemeType");
                int i32 = cd2;
                if (intField != 127) {
                }
                z7 = ae6;
                z8 = true;
                if (intField != 140) {
                }
                z9 = ae5;
                z10 = false;
                if (intField != 145) {
                }
                z11 = false;
                boolean z152 = ae3;
                if (!ae3) {
                }
                z12 = false;
                if (!ae2) {
                }
                if (!cl) {
                    arrayList.add(next);
                }
                it = it2;
                gson = gson2;
                cg = list2;
                str2 = str4;
                cd = i2;
                cd2 = i32;
                ae6 = z7;
                str3 = str;
                ae5 = z9;
                ae3 = z152;
                ae2 = z13;
            }
            String str5 = str2;
            if (!arrayList.isEmpty() || !ae) {
                XposedHelpers.setObjectField(obj, str5, arrayList);
            }
            if (arrayList.isEmpty() && ae) {
                j.bi(new Object[]{"筛选数量不足,中断筛选,将由原程序处理"});
            }
        }
    }

    public final void a() {
        j.bd("com.bytedance.retrofit2.SsResponse", "success", new Object[]{Object.class, j.ak("com.bytedance.retrofit2.client.Response"), new a(this)});
    }
}
